<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta charset="UTF-8">
    <title>创建班级</title>
    <link rel="stylesheet" type="text/css" href="css/frameHtml.css">
    <script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui.min.js"></script>
	<link type="text/css" rel="stylesheet" href="css/drop-down.css">
	<script type="text/javascript" src="js/select-widget-min.js"></script>
	<script type="text/javascript" src="js/layer/layer.js"></script>
	<style type="text/css">
		#course_type{
			width: 200px;
			height: 30px;
			border: 1px solid #3e5b79; 
		}
		#course_type option{
			height: 30px; 
		}
	</style>
	<script type="text/javascript">
    $(document).ready(function () {
		$.ajax({
			url:"../teaUserCheck.do",
			type:"post",
			dataType:"json",
			success:function(data){
				$("#name").html(data.name)
			}
		});
    	$("#submit").click(function(){
    		if($("#course_name").val()==""){
    			layer.msg('请输入课程名称', {time:22000,icon: 5});
    		}else if($("#course_info").val()==""){
    			layer.msg('请输入课程简介', {time: 2000,icon: 5});
    		}else{
    			var course_name = $("#course_name").val();
    			var course_info = $("#course_info").val();    			
    			var course_type = $("#course_type").val();    			
	    			$.ajax({
						url:"../addCourse.do",
						type:"post",
						dataType:"json",
	        			data:"course_name="+course_name+"&course_info="+course_info+"&course_type="+course_type,
	        			success:function(data){
		        					layer.msg('课程添加成功，请等待管理员审核！！', {time: 2000,icon: 1});
		        	    			$("#course_name").val("");
		        	    			$("#course_info").val("");    			
	        				}
	    					
	    			  });
    			}
    			});
	    });
	</script>
</head>
<body>
<table class="addClass" border="0" cellspacing="0" cellpadding="0">
	<!-- 1、课程名称
		 2、课程类别
		 3、课程描述
		 4、 -->
    <tr><th>课程名称</th><td><input type="text" id="course_name" placeholder="课程名称" ></td><td></td></tr>
    <tr><th>课程方向</th><td>
        <div style="width: 200px; display: inline-block; vertical-align:top;">
            <select name="course_type" id="course_type" class="ui-select">
                <option value="体育类">体育类</option>
                <option value="文化类">文化类</option>
                <option value="艺术类">艺术类</option>
                <option value="科技类">科技类</option>
            </select>
        </div>
    </td><td></td></tr>
	<tr><th>课程教师</th><td><span style="color: #3e5b79" id="name"></span></td><td></td></tr>
    <tr><th>课程描述</th><td><input type="text" id="course_info" placeholder="课程详细介绍"></td><td></td></tr>
    
</table>
<div class="operationGather"><button class="submit" id="submit">提&nbsp;&nbsp;&nbsp;&nbsp;交</button></div>

</body>
</html>
